import 'dart:math';

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:number_spark_flutter/routes/ns_app_pages.dart';
import 'package:number_spark_flutter/style/ns_style.dart';
import 'package:number_spark_flutter/widgets/brick/ns_brick.dart';

class DoubleResultDialog extends StatelessWidget {
  const DoubleResultDialog({super.key, required this.isMeWin, this.isDraw = false});

  final bool isMeWin;
  final bool isDraw;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.transparent,
      body: Transform.rotate(
        angle: isMeWin ? 0 : pi,
        child: Center(
          child: Stack(
            alignment: Alignment.bottomCenter,
            children: [
              NSImage(
                assetImage: isDraw
                    ? 'img_bg_double_result_draw_dialog.png'
                    : isMeWin
                        ? 'img_bg_double_result_me_win_dialog.png'
                        : 'img_bg_double_result_you_win_dialog.png',
                width: 317.w,
              ),
              NSImage(
                margin: EdgeInsets.only(bottom: 35.w),
                assetImage: 'img_bg_double_ok_btn.png',
                width: 194.w,
                onTap: () {
                  Get.until((route) => route.settings.name == NSRoutes.main);
                },
              )
            ],
          ),
        ),
      ),
    );
  }
}
